package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ScoreEntityMapper;
import com.ruoyi.system.domain.ScoreEntity;
import com.ruoyi.system.service.IScoreEntityService;
import com.ruoyi.common.core.text.Convert;

/**
 * 学生成绩Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-31
 */
@Service
public class ScoreEntityServiceImpl implements IScoreEntityService 
{
    @Autowired
    private ScoreEntityMapper scoreEntityMapper;

    /**
     * 查询学生成绩
     * 
     * @param studentId 学生成绩主键
     * @return 学生成绩
     */
    @Override
    public ScoreEntity selectScoreEntityByStudentId(String studentId)
    {
        return scoreEntityMapper.selectScoreEntityByStudentId(studentId);
    }

    /**
     * 查询学生成绩列表
     * 
     * @param scoreEntity 学生成绩
     * @return 学生成绩
     */
    @Override
    public List<ScoreEntity> selectScoreEntityList(ScoreEntity scoreEntity)
    {
        return scoreEntityMapper.selectScoreEntityList(scoreEntity);
    }

    /**
     * 新增学生成绩
     * 
     * @param scoreEntity 学生成绩
     * @return 结果
     */
    @Override
    public int insertScoreEntity(ScoreEntity scoreEntity)
    {
        scoreEntity.setCreateTime(DateUtils.getNowDate());
        return scoreEntityMapper.insertScoreEntity(scoreEntity);
    }

    /**
     * 修改学生成绩
     * 
     * @param scoreEntity 学生成绩
     * @return 结果
     */
    @Override
    public int updateScoreEntity(ScoreEntity scoreEntity)
    {
        scoreEntity.setUpdateTime(DateUtils.getNowDate());
        return scoreEntityMapper.updateScoreEntity(scoreEntity);
    }

    /**
     * 批量删除学生成绩
     * 
     * @param studentIds 需要删除的学生成绩主键
     * @return 结果
     */
    @Override
    public int deleteScoreEntityByStudentIds(String studentIds)
    {
        return scoreEntityMapper.deleteScoreEntityByStudentIds(Convert.toStrArray(studentIds));
    }

    /**
     * 删除学生成绩信息
     * 
     * @param studentId 学生成绩主键
     * @return 结果
     */
    @Override
    public int deleteScoreEntityByStudentId(String studentId)
    {
        return scoreEntityMapper.deleteScoreEntityByStudentId(studentId);
    }
}
